﻿/*              Copyright(c) 2008 Dave Sexton              *
 * http://www.codeplex.com/DocProject                      *
 * http://www.codeplex.com/DocProject/Project/License.aspx *
 ***********************************************************/
using System;
using System.Collections.Generic;
using System.Text;

namespace DaveSexton.DocToMaml.Extensions
{
	internal static class ListExtensions
	{
		public static bool Contains<T>(this IList<T> list, T item, IEqualityComparer<T> comparer)
		{
			if (comparer == null)
				throw new ArgumentNullException("comparer");

			foreach (T i in list)
				if (comparer.Equals(i, item))
					return true;

			return false;
		}
	}
}